<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<!--①注意head是否有样式冲突，引入富文本框需要的css文件-->
<head>
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<link th:href="@{favicon.ico}" rel="shortcut icon"/>
	<link th:href="@{/css/bootstrap.min14ed.css?v=3.3.6}" rel="stylesheet"/>
	<link th:href="@{/css/font-awesome.min93e3.css?v=4.4.0}" rel="stylesheet"/>
	<link th:href="@{/css/animate.min.css}" rel="stylesheet"/>
	<link th:href="@{/css/plugins/simditor/simditor.css}" rel="stylesheet" type="text/css"/>
	<link th:href="@{/css/style.min862f.css?v=4.1.0}" rel="stylesheet"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
	<form class="form-horizontal m" id="form-suggest-add">
		<div class="form-group">
			<label class="col-sm-3 control-label">标题：</label>
			<div class="col-sm-8">
				<input id="mtitle" name="mtitle" class="form-control" type="text">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">内容：</label>
			<div class="col-sm-8">
				<textarea id="mcontent" name="mcontent" placeholder="这里输入内容" autofocus></textarea>
				<!--②使用textare去作为富文本输入框-->
			</div>
		</div>

		<input id="uid" name="uid" th:value="${userid}" class="form-control" type="hidden">
		<input id="uname" name="uname" th:value="${uname}" class="form-control" type="hidden">
		<input id="aid" name="aid" th:value="${aid}" class="form-control" type="hidden">

		<input id="mtype" name="mtype" value="1" class="form-control" type="hidden" >
		<div class="form-group">
			<label class="col-sm-3 control-label">状态：</label>
			<div class="col-sm-8">
				<div class="onoffswitch">
					<input type="checkbox"  class="onoffswitch-checkbox" id="ctype1" name="ctype1" checked onclick="changevalue();" />
					<label class="onoffswitch-label" for="ctype1">
						<span class="onoffswitch-inner"></span>
						<span class="onoffswitch-switch"></span>
					</label>

				</div>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">备注：</label>
			<div class="col-sm-8">
				<input id="note" name="note" class="form-control" type="text">
			</div>
		</div>
	</form>
</div>
<div th:include="include::footer"></div>
<!--③引入富文本框需要的js文件-->
<script th:src="@{/js/plugins/simditor/module.js}"></script>
<script th:src="@{/js/plugins/simditor/uploader.js}"></script>
<script th:src="@{/js/plugins/simditor/hotkeys.js}"></script>
<script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
<script th:src="@{/js/plugins/simditor/simditor.js}"></script>
<script type="text/javascript">
	var prefix = ctx + "village/suggest"
	$("#form-suggest-add").validate({
		rules:{
			xxxx:{
				required:true,
			},
		}
	});

	function submitHandler() {
		if ($.validate.form()) {
			$.operate.save(prefix + "/add", $('#form-suggest-add').serialize());
		}
	}
</script>
<!--④定义富文本框-->
<script>
	var editor = new Simditor({placeholder: "输入内容", toolbar: ['title', 'bold', 'underline', 'color', '|', 'ol', 'ul', 'table'], textarea: '#mcontent',});
</script>

<script>
	function changevalue() {
		var ctype2 = document.getElementsByName("ctype1");
		if (ctype2.checked == true){
			$("#mtype").val("1");
		}else{
			$("#mtype").val("0");
		}
	}
</script>
</body>
</html>
